package net.comm.message.web.form;

import net.comm.page.PageCtr;

import org.apache.struts.action.*;


public class MessageForm extends ActionForm {

	private static final long serialVersionUID = 1L;
	private static final String KEY_SPLIT = "#,##,#,#,#";

	private int  QryReceiver;		//接收用户ID
	private int  QrySender;			//发送用户ID
	private String  QrySendertype;	//发送用户类型
	private String  QryRecvDelflg;	//接收用户删除标志
	private String  QrySndDelflg;	//发送用户删除标志
	private String  QryMtype;		//消息类型
	private String  QryPrevNext;	//查询方向
	private int  	QrySeqID;		//接收用户ID
	private String  QryOrderby;		//排序字段

	private int  	SeqID;			//消息序号ID
	private int  	Receiver;		//接收用户ID
	private int  	Sender;			//发送用户ID
	private String  Sendertype;		//发送用户类型
	private int  	MsgID;			//消息序号
	private String  Mtype;			//消息类型
	private String  Title;		//标题
	private String  Status;		//接收方消息状态
	private String  Rtime;		//阅读日期时间
	private String  RecvDelflg;	//接收用户删除标志
	private String  SndDelflg;	//发送用户删除标志
	private String  Stime;		//发送日期时间
	private String  Mtime;		//最后修改日期
	
	private String  PrevIsExist;	//存在前一封
	private String  NextIsExist;	//存在下一封

	private int  Select;		//当前选定记录
	
	private String  Msg;		//消息内容
	
	public MessageForm() {
		super();
		// TODO Auto-generated constructor stub
		QryReceiver = 0;
		QrySender = 0;
		QrySendertype = "";
		QryRecvDelflg = "";
		QrySndDelflg = "";
		QryMtype = "";
		QryPrevNext = "";
		QrySeqID = 0;
		QryOrderby = "";

		SeqID = 0;
		Receiver = 0;
		Sender = 0;
		Sendertype = "";
		MsgID = 0;
		Mtype = "";
		Title = "";
		Status = "";
		Rtime = "";
		RecvDelflg = "";
		SndDelflg = "";
		Stime = "";
		Mtime = "";
		Select = 0;
		Msg = "";
		
		PrevIsExist = "";	//存在前一封
		NextIsExist = "";	//存在下一封	
		
		action = "";
	}

	private String action = "";
	
	/**
	 * 查询当前页主键值串
	 */
	private String key = "";

	/**
	 * 查询上上页主键值串
	 */
	private String lastKey = "";
	

	/**
	 * 分页控制对象
	 */
	private PageCtr page;
	



	public PageCtr getPage() {
		return page;
	}

	public void setPage(PageCtr page) {
		this.page = page;
	}
	
	/**
	 * @param key the key to set
	 */
	public void setKey(String key) {
		this.key = key;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String[] array) {
		if(key != null && key.trim().length() > 0) {
			key = "";
		}
		
		StringBuffer keyBuff = new StringBuffer();
		for (int i = 0; i < array.length; i++) 
		{
			/**
			 * 防止空字符串引起的split方法异常
			 */
			if(array[i] == null || array[i].length() == 0) {
				keyBuff.append(" ");
			} else {
				keyBuff.append(array[i]);
			}
			
			keyBuff.append(KEY_SPLIT);
		}
		
		key = keyBuff.toString();		
	}
	
	/**
	 * 获取lastKey值
	 * @return
	 */
	public String[] lastKey()
	{
		if(lastKey == null || lastKey.trim().length() == 0) {
			return null;
		}
		
		return lastKey.split(KEY_SPLIT);
	}
	
	public String getLastKey() {
		return lastKey;
	}

	public void setLastKey(String lastKey) {
		this.lastKey = lastKey;
	}	

	public String getAction() {
		return action;
	}
	public void setAction(String action) {
		this.action = action;
	}

	public static String getKEY_SPLIT() {
		return KEY_SPLIT;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}



	public String getTitle() {
		return Title;
	}

	public String getStatus() {
		return Status;
	}


	public String getRecvDelflg() {
		return RecvDelflg;
	}

	public String getSndDelflg() {
		return SndDelflg;
	}

	public int getSelect() {
		return Select;
	}

	public void setSelect(int select) {
		Select = select;
	}


	public void setTitle(String title) {
		Title = title;
	}

	public void setStatus(String status) {
		Status = status;
	}


	public void setRecvDelflg(String recvDelflg) {
		RecvDelflg = recvDelflg;
	}

	public void setSndDelflg(String sndDelflg) {
		SndDelflg = sndDelflg;
	}

	public String getRtime() {
		return Rtime;
	}

	public String getStime() {
		return Stime;
	}

	public String getMtime() {
		return Mtime;
	}

	public void setRtime(String rtime) {
		Rtime = rtime;
	}

	public void setStime(String stime) {
		Stime = stime;
	}

	public void setMtime(String mtime) {
		Mtime = mtime;
	}

	public String getQrySendertype() {
		return QrySendertype;
	}

	public String getQryRecvDelflg() {
		return QryRecvDelflg;
	}

	public String getQrySndDelflg() {
		return QrySndDelflg;
	}


	public void setQrySendertype(String qrySendertype) {
		QrySendertype = qrySendertype;
	}

	public void setQryRecvDelflg(String qryRecvDelflg) {
		QryRecvDelflg = qryRecvDelflg;
	}

	public void setQrySndDelflg(String qrySndDelflg) {
		QrySndDelflg = qrySndDelflg;
	}

	public int getQryReceiver() {
		return QryReceiver;
	}

	public int getQrySender() {
		return QrySender;
	}

	public int getSeqID() {
		return SeqID;
	}

	public int getReceiver() {
		return Receiver;
	}

	public int getSender() {
		return Sender;
	}

	public String getSendertype() {
		return Sendertype;
	}

	public int getMsgID() {
		return MsgID;
	}

	public void setQryReceiver(int qryReceiver) {
		QryReceiver = qryReceiver;
	}

	public void setQrySender(int qrySender) {
		QrySender = qrySender;
	}

	public void setSeqID(int seqID) {
		SeqID = seqID;
	}

	public void setReceiver(int receiver) {
		Receiver = receiver;
	}

	public void setSender(int sender) {
		Sender = sender;
	}

	public void setSendertype(String sendertype) {
		Sendertype = sendertype;
	}

	public void setMsgID(int msgID) {
		MsgID = msgID;
	}

	public String getMtype() {
		return Mtype;
	}

	public void setMtype(String mtype) {
		Mtype = mtype;
	}

	public String getMsg() {
		return Msg;
	}

	public void setMsg(String msg) {
		Msg = msg;
	}

	public String getQryMtype() {
		return QryMtype;
	}

	public void setQryMtype(String qryMtype) {
		QryMtype = qryMtype;
	}

	public String getQryPrevNext() {
		return QryPrevNext;
	}

	public void setQryPrevNext(String qryPrevNext) {
		QryPrevNext = qryPrevNext;
	}

	public int getQrySeqID() {
		return QrySeqID;
	}

	public void setQrySeqID(int qrySeqID) {
		QrySeqID = qrySeqID;
	}

	public String getPrevIsExist() {
		return PrevIsExist;
	}

	public String getNextIsExist() {
		return NextIsExist;
	}

	public void setPrevIsExist(String prevIsExist) {
		PrevIsExist = prevIsExist;
	}

	public void setNextIsExist(String nextIsExist) {
		NextIsExist = nextIsExist;
	}

	public String getQryOrderby() {
		return QryOrderby;
	}

	public void setQryOrderby(String qryOrderby) {
		QryOrderby = qryOrderby;
	}


	
}